//
//  IMGground.m
//  Space iOS
//
//  Created by tucici on 2019/1/24.
//

#import "IMGground.h"
@interface IMGground ()
@property (nonatomic, strong) YJDImageView *IMG;

@end
@implementation IMGground
- (instancetype)init
{
    self = [super init];
    if (self)
    {
        self.IMG.hidden = NO;
    }
    return self;
}
- (YJDImageView *)IMG
{
    if (!_IMG)
    {
        _IMG = [[YJDImageView alloc]initWithImageName:@"Default"];
        [self yjd_getLaunchImage];
        [self addSubview:_IMG];
        [_IMG mas_makeConstraints:^(SK_MASConstraintMaker *make) {
            make.edges.mas_offset(UIEdgeInsetsZero);
        }];
    }
    return _IMG;
}

- (void)yjd_getLaunchImage
{
   NSArray *images = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"UILaunchImages"];
    NSLog(@"images  %@",images);
   NSString *string = [images[0] valueForKey:@"UILaunchImageName"];
     _IMG.image = [UIImage imageNamed:string];
}
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [super touchesEnded:touches withEvent:event];
    self.img_block();
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
